package com.example.demo.exception;


public class BusinessException extends CommonException {
    private int code;

    public BusinessException() {
        this.code = ErrorCode.FAIL.getCode();
    }

    public BusinessException(String msg) {
        super(msg);
        this.code = ErrorCode.FAIL.getCode();
    }

    public BusinessException(int code, String msg) {
        super(msg);
        this.code = ErrorCode.FAIL.getCode();
        this.code = code;
    }

    public BusinessException(int code, String msg, Throwable cause) {
        super(code, msg, cause);
        this.code = ErrorCode.FAIL.getCode();
    }

    public int getCode() {
        return this.code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
